<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="https://cdn.bootcss.com/vue/2.5.17-beta.0/vue.min.js"></script>
	</head>

	<body>
		<div id="app">
			<!-- 绑定的是一个无参 函数,直接写函数名,小括号可以省略 -->
			<button @click="fun1">点我啊</button>
			<input type="text" v-model="message" />
			<p @mousemove="mm">
				x:{{x}} y:{{y}}
				<span @mousemove.stop>鼠标移动到此即停止</span>
			</p>
		</div>
		<script>
			new Vue({
				el: "#app",
				data: {
					message: "哦呵呵",
					x: 0,
					y: 0
				},
				methods: {
					mm: function(event) {
						console.log(event)
						this.x = event.clientX;
						this.y = event.clientY;
					},
					stopm: function(event) {
						event.stopPropagation();
					},
					fun1() {
						//调用vue的设置的函数
						this.fun2();
					},
					fun2() {
						/* 调用vue的属性 */
						/* this 代表vue的实例 */
						alert(this.message)
						this.message = "T_T"
					}
				}
			})
		</script>
	</body>

</html>